package com.a918.consensus;

import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

class DPoSNode extends Node {
    private final double timeout;
//    private final Map<Integer, CycleState> cycleStates = new HashMap<>();
    private int cycle = 0;
    private double nextTimer;
//    private Phase phase = Phase.PrePrepare;
    private CopyOnWriteArrayList<Block> blockChain = new CopyOnWriteArrayList<>();

    DPoSNode(EarthPosition position, double timeout) {
        super(position);
        this.timeout = timeout;
    }

    DPoSNode(EarthPosition position, double timeout, double credit, double token) {
        super(position,credit,token);
        this.timeout = timeout;
    }

    //开始共识
    @Override void onStart(Simulation simulation) {

    }

    @Override void onTimerEvent(TimerEvent timerEvent, Simulation simulation) {

    }

    @Override void onMessageEvent(MessageEvent messageEvent, Simulation simulation) {

    }

    //添加新区块
    @Override
    public boolean addBlock(Block blcok){
       return true;
    }


}

